/*
 *  File: BucketPoolOutputObserverFactory.java 
 *
 *  @author jeffliu
 *  @date Jun 24, 2011
 *  @version 
 */
package com.yulookbook.web.output;

import java.util.LinkedList;
import java.util.List;

import javax.servlet.ServletResponse;

import org.apache.commons.lang.StringUtils;

public class BucketPoolOutputObserverFactory {
	public static List<BucketPoolOutputObserver> getObservers(String key, ServletResponse response, StringBuffer buffer){
		List<BucketPoolOutputObserver> observers = new LinkedList<BucketPoolOutputObserver>();
		if(!StringUtils.isEmpty(key)){
			if(key.toLowerCase().equals("gson")){
				observers.add(new GsonResponseBucketPoolOutputer(response, buffer));
			}else if(key.toLowerCase().equals("html")){
				observers.add(new HtmlRespsonseBucketPoolOutputer(response, buffer));
			}
		}
		return observers;
	}
}
